﻿namespace Example
{
    using System;
    using System.Reflection;

    using Xunit;

    public sealed class WallFacts
    {
        [Fact]
        public void IDispatch()
        {
#if DEBUG
            var type = Type.GetTypeFromProgID("Example.Wall");
            var obj = Activator.CreateInstance(type);

            var result = (string)type.InvokeMember("Echo", 
                                                   BindingFlags.InvokeMethod, 
                                                   null, 
                                                   obj, 
                                                   new object[] { "parameter" });

            Assert.Equal("parameter", result);
#endif
        }
    }
}